﻿using UnityEngine;
using System.Collections;

public class MenuPrincipal : MonoBehaviour
{


		public Texture background;
		public GUIStyle buttonBackground;
		public float guiElementX;
		public float guiElementXWidth;
		public float guiElementY;
		public float guiElementYMargen;
		public bool guiShowElements;

		void OnGUI ()
		{
				if (guiShowElements) {
						//Mostra a tela de fundo
						GUI.DrawTexture (new Rect (0, 0, Screen.width, Screen.height), background);

			
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * guiElementYMargen), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Iniciar")) {

								Application.LoadLevel(1);
						}
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * (guiElementYMargen * 2)), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Tutorial")) {
								print ("Iniciar Clicked");
						}
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * (guiElementYMargen * 3)), Screen.width * guiElementXWidth, Screen.height * .1f),
			    "Opcoes")) {
								print ("Iniciar Clicked");
						}
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * (guiElementYMargen * 4)), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Creditos")) {
								print ("Iniciar Clicked");
						}
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * (guiElementYMargen * 5)), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Sair")) {
								print ("Iniciar Clicked");
						}
				} else if (false) {

						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * guiElementYMargen), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Iniciar", buttonBackground)) {
								print ("Iniciar Clicked");
						}
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * (guiElementYMargen * 2)), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Tutorial", buttonBackground)) {
								print ("Iniciar Clicked");
						}
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * (guiElementYMargen * 3)), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Opcoes", buttonBackground)) {
								print ("Iniciar Clicked");
						}
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * (guiElementYMargen * 4)), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Creditos", buttonBackground)) {
								print ("Iniciar Clicked");
						}
						if (GUI.Button (new Rect (Screen.width * guiElementX, (Screen.height * guiElementY) + (Screen.height * (guiElementYMargen * 5)), Screen.width * guiElementXWidth, Screen.height * .1f),
			                "Sair", buttonBackground)) {
								print ("Iniciar Clicked");
						}
			
				}
		}
	
		// Use this for initialization
		void Start ()
		{

		}
	
		// Update is called once per frame
		void Update ()
		{
	
		}
}
